package com.cicigodd.brick.plug.common.tree.node;

import com.cicigodd.brick.plug.common.tree.factory.base.AbstractTreeNode;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.List;

/**
 * 通用树节点
 *
 * @author cicigodd
 * @date 2020/12/27 18:36
 */
@Data
public class ElementTreeNode implements AbstractTreeNode {

    @ApiModelProperty("父id，一级节点父id是-1")
    private Integer parentId;

    @ApiModelProperty("节点值")
    private Integer id;

    @ApiModelProperty("节点名称")
    private String label;

    @ApiModelProperty("子节点的集合")
    private List<ElementTreeNode> children;

    @Override
    public String getNodeId() {
        return this.id.toString();
    }

    @Override
    public String getNodeParentId() {
        return this.parentId.toString();
    }

    @Override
    public void setChildrenNodes(List childrenNodes) {
        this.children = childrenNodes;
    }
}
